home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / bmp_db / bmp_db.bas next >
BASIC Source File  |  1995-10-23  |  1KB  |  52 lines

  1. Sub PicDB_Add (Filename As String, Bitmapname As String, Caption As String, PicBox As Control)
  2. 'Procces data
  3. X = FreeFile
  4. Open Filename For Binary As #X
  5. If LOF(1) = 0 Then GoTo npos
  6. Get #X, 1, NOR%
  7. npos:
  8. NOR% = NOR% + 1
  9. Put #X, 1, NOR%
  10. R = LOF(X) + 1
  11. E% = Len(Caption)
  12. Put #X, R, E%
  13. Put #X, , Caption
  14. Y = FreeFile
  15. Open Bitmapname For Binary As #Y
  16. O& = LOF(Y)
  17. Put #X, , O&
  18. L$ = String$(O&, " ")
  19. Get #Y, , L$
  20. Put #X, , L$
  21. Close #Y
  22. Close #X
  23. End Sub
  24.  
  25. Sub PICDB_Load (Filename As String, Recnum As Integer, Caption As String, Pic As Control)
  26. X = FreeFile
  27. Open Filename For Binary As #X
  28. Get #X, 1, E%
  29. For I = 1 To (Recnum - 1)
  30. Get #X, , E%
  31. R$ = String$(E%, " ")
  32. Get #X, , R$
  33. Get #X, , O&
  34. R$ = String$(O&, " ")
  35. Get #X, , R$
  36. Next
  37. Get #X, , E%
  38. Caption = String$(E%, " ")
  39. Get #X, , Caption
  40. Get #X, , O&
  41. R$ = String$(O&, " ")
  42. Get #X, , R$
  43. Y = FreeFile
  44. Open "BMPDB.TMP" For Output As #Y
  45. Print #Y, R$
  46. Close #Y
  47. Close #X
  48. Pic.Picture = LoadPicture("BMPDB.TMP")
  49. Kill "BMPDB.tmp"
  50. End Sub
  51.  
  52.